Skip to main content
To make the process of creating smart sessions easier, we provide a set of helper functions.

createContractPermission

This helper function is used to create a permission for a smart contract function.

Example

Params

address

The address of the target contract.

functionSignature

The human-readable function signature.

rules

An array of rules to apply to the function’s arguments.

onlyOnce

If true, this function can only be successfully called once during the session.

Return type

Returns a Permission.

createContractPermissions

Same as createContractPermission, but it creates multiple permissions for the same contract.

Example

Params

address

The address of the target contract.

functions

An array of FunctionPermission

Return type

Returns a Permission[].
See these utilities in action here.